//
//  JWWalfareWebController.m
//  见闻新闻
//
//  Created by brother on 16/3/9.
//  Copyright © 2016年 JoanBoat. All rights reserved.
//

#import "JWWalfareWebController.h"
#import "JWAuslese.h"
#import "JWNewsTool.h"


@interface JWWalfareWebController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation JWWalfareWebController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    if (self.htmlFieldBlock) {
        JWAuslese *auslese = self.htmlFieldBlock();
        
        if ([JWNewsTool ausleseWithQueryId:auslese.jx_id].count > 0) {
            NSLog(@"1111111");
            NSMutableArray *dataArray = [JWNewsTool ausleseWithQueryId:auslese.jx_id];
            for (JWAuslese *auslese in dataArray) {
                [self.webView loadHTMLString:auslese.jx_html baseURL:nil];
            }
        }else {
            NSLog(@"2222222");
            if (auslese.jx_html) {
                [self.webView loadHTMLString:auslese.jx_html baseURL:nil];
            }else {
                return;
            }
            
        }
        
        
        
        
    }
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
